package csel.controller.events;

import java.awt.event.ActionEvent;

import csel.controller.bindings.ActionBindings;
import csel.controller.enums.ActionEnum;

/**
 * Purpose: To map action events to ActionEnums
 * 
 * @author Nikolas Wolfe
 */

public class Action implements Event
{
	private final ActionEvent event;
	private final ActionBindings actionBindings;
	
	public Action( ActionEvent event, ActionBindings actionBindings )
	{
		this.actionBindings = actionBindings;
		this.event = event;
	}
	
	@Override
	public ActionEnum getActionEnum()
	{
		return actionBindings.getEnum(event.getActionCommand());
	}
	
	public ActionEvent getActionEvent()
	{
		return this.event;
	}
}
